#ifndef ZIPPROGRAMFILE_H
#define ZIPPROGRAMFILE_H

#include <QObject>
#include "3rdLib/minizip/zip.h"


struct ZipFilePath {
    QString rootPath;
    QString savePath;
};

class ZipProgramFile : public QObject
{
    Q_OBJECT
public:
    explicit ZipProgramFile(QObject *parent = nullptr);

    void zipProgramFile(const QString &zipName,
                        const QString &folderPath);

private:
    int zipFiles(const QString &zipFileName,
                 const QList<ZipFilePath> &files,
                 bool bAppendFile=false,
                 int nCompressLevel=0);
    int isLargeFile(std::string filename);

    /* f: name of file to get info on
     * tmzip: access, modific. and creation times
     * dt: dostime
     */
    uLong filetime(const char* f, tm_zip *tmzip, uLong *dt);

    QString readFile(const QString &filePath);
};

#endif // ZIPPROGRAMFILE_H
